/**
 * 作业范围相关接口
 */
import request from '@/utils/request'

/**
 * 获取作业范围
 * @param {*} id 机构Id
 * @param {*} type 类型，1-机构，2-快递员
 */
export function getInstitutionsJobsArea(id, type) {
  return request({
    url: `/manager/business-hall/scope/${id}/${type}`,
    method: 'GET'
  })
}

/**
 * 保存作业范围
 */
export function saveInstitutionsJobsArea(data) {
  return request({
    url: '/manager/business-hall/scope',
    method: 'POST',
    data: {
      bid: data.bid,
      created: data.created,
      latitude: data.latitude,
      longitude: data.longitude,
      polygon: data.polygon,
      type: data.type,
      updated: data.updated
    }
  })
}

/**
 * 删除作业范围
 * @param {*} id 机构Id
 * @param {*} type 类型，1-机构，2-快递员
 */
export function deleteInstitutionsJobsArea(id, type) {
  return request({
    url: `/manager/business-hall/scope/${id}/${type}`,
    method: 'GET'
  })
}
